package com.example.blogsystem.demos.model;

import com.example.blogsystem.demos.utils.DateUtils;
import lombok.Data;

import java.util.Date;

@Data
public class BlogInfo {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;
    private Integer deleteFlag;
    private Date createTime;
    private Date updateTime;
    /**
     * 是否是当前作者
     */
    private boolean isAdmin;

    public boolean isAdmin() {
        return isAdmin;
    }

    public void setAdmin(boolean admin) {
        isAdmin = admin;
    }

    public String getCreateTime() {
        return DateUtils.formatDate(this.createTime);
    }
}
